<template>
    <div class="type-list">
        <div class="type-item">
            <div class="title-box">
                <span class="title">全网查询</span>
                <span class="more">
                    更多
                    <i class="iconfont icon-right"></i>
                </span>
             
            </div>
            <div class="list-film">
                <FilmItem class="list-item" v-for="(film, i) in films" :film="film" :key="i"></FilmItem>
            </div>
           
        </div>
    </div>
    
</template>
<script>
import axios from 'axios';
import FilmItem from '../components/FilmItem.vue'
    export default {
        components:{
            FilmItem
        },
        data(){
            return {
                films:[]
            }
        },
        methods:{
            async loadListData(){
                let { data } = await axios.get('http://127.0.0.1:3000/public/films',{
                    params:{
                       tid: this.$route.params.tid,
                        pageSize:12
                    }
                    
                })
                this.films=data.data
            }
        },
        created (){
            this.loadListData();
        }
    }
</script>